<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of m_mausac
 *
 * @author Tuyet
 */
class M_mausac extends CI_Model {

    function __construct() {
        parent::__construct();
        $this->load->database();
    }

    function getallcolor() {
        $sql = $this->db->get('mausac');
        $result = $sql->result();
        return $result;
    }

    function getmausac() {
        $results = $this->db->get_where('mausac', array('mamausac' => $mamausac));
        $result = $results->result();
        $result = $results[0];
        return $result;
    }

    function getmamausac($tenmausac) {
        $item = 0;
        $query = $this->db->get_where('mausac', array('tenmausac' => $tenmausac));
        foreach ($query->result() as $row) {
            $item = $row->mamausac;
        }

        return $item;
    }

}

?>
